-
get-privacyGet Site Privacy -
set-privacySet Site Privacy
Get Site Privacy
Returns who can visit a site and what its privacy can be changed to. It gives the privacy level (machine key, stored blog_public value, label and description), whether it is private, whether a site password is set, whether the members level is supported, and the levels the site can be set to. Requires manage_options on the site. Pass site_id to act on another site you belong to.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
site_id |
integer | No | Optional. ID of another site in the network to act on; list-my-sites gives the sites you belong to. Permissions are checked on that site. Omit for this site. |
Set Site Privacy
Changes who can visit a site, takes effect at once, and is reversible by calling it again. level is one of public, hidden-from-search, logged-in (anyone logged in to the network), site-users (users with a role on the site), administrators, password (anyone with the site password, plus site users) or members (true members, only where a membership plugin answers who is a member). password sets a new site password, which signs out everyone who entered the old one; it is required when choosing the password level if none is set yet. Pass level, password or both. Everything is checked before anything is saved. The members level can only be set from a connection to the site itself. Returns the level before and after and the site state. Requires manage_options on the site. Pass site_id to act on another site you belong to.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
level |
string | No | The new privacy level. One of: public, hidden-from-search, logged-in, site-users, administrators, password, members. |
|
password |
string | No | A new site password for the password level. Stored hashed. | |
task_id |
integer | No | Optional. The lh-tasks task this call is working on. Pass with claim_token: the call is refused unless you hold that claim, and a successful call renews it. |
|
claim_token |
string | No | Optional. The claim_token from claim-next-task for task_id. Required when task_id is given. |
|
site_id |
integer | No | Optional. ID of another site in the network to act on; list-my-sites gives the sites you belong to. Permissions are checked on that site. Omit for this site. |